package com.zyz.I_多线程.线程通信;

/**
 * @author: vick
 * @Date: 2025/3/24
 * @Description:
 * @version: 1.0
 */
public class ConsumerProducerTest {
    public static void main(String[] args) {
        Storage storage = new Storage();
        Producer producer = new Producer(storage);
        Consumer consumer1 = new Consumer(storage);
        Consumer consumer2 = new Consumer(storage);

        Thread thread1 = new Thread(producer, "生产者");
        Thread thread2 = new Thread(consumer1, "消费者1");
        Thread thread3 = new Thread(consumer2, "消费者2");

        thread1.start();
        thread2.start();
        thread3.start();
    }
}
